//
//  ForgetPasswordViewController.m
//  DianDangDai
//
//  Created by bhf on 2017/12/15.
//  Copyright © 2017年 bhf. All rights reserved.
//

#import "ForgetPasswordViewController.h"
#import "BMCell.h"
@interface ForgetPasswordViewController ()<UITextFieldDelegate>
@property (nonatomic, strong) NSArray *imgArray;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *placeholderArray;

@end

@implementation ForgetPasswordViewController

- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}



- (void)viewDidLoad {
    [super viewDidLoad];
    _imgArray = @[@"phone",@"inviter",@"graphic",@"password",@"password",];
    _titleArray = @[@"手机号",@"图形码",@"验证码",@"新密码",@"新密码"];
    _placeholderArray = @[@"请输入手机号",@"请输入图形码",@"请输入验证码",@"请输入新密码",@"再次输入新密码"];
    self.affirm.layer.cornerRadius = 18;
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - TableView Data Source

- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}



- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    NSString *identifier;
    
    switch (indexPath.row) {
        case 0:
            identifier = @"bm_cell_II";
            break;
        case 1:
            identifier = @"bm_cell_III";
            break;
        case 2:
            identifier = @"bm_cell_III";
            break;
        case 3:
            identifier = @"bm_cell_II";
            break;
        case 4:
            identifier = @"bm_cell_II";
            break;
        default:
            break;
    }
    
    
    BMCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
    cell.textField.delegate = self;
    cell.image.image = [UIImage imageNamed:_imgArray[indexPath.row]];
    cell.name.text = _titleArray[indexPath.row];
    NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:_placeholderArray[indexPath.row] attributes:
                                      @{NSForegroundColorAttributeName:[UIColor whiteColor],
                                        NSFontAttributeName:cell.textField.font
                                        }];
    //  textField.attributedPlaceholder = attrString;
    cell.textField.attributedPlaceholder = attrString;
    cell.textField.tag = indexPath.row+100;
    
    if (indexPath.row == 1) {
        [cell.button setTitle:@"图形码" forState:UIControlStateNormal];
        cell.textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    
    }
    if (indexPath.row == 2) {
       
    
    }
    return cell;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
